{% macro styling() %}
    <link rel="stylesheet" href="{{ get_url(path="split.css") }}">

    {%- if config.extra.custom_css is defined -%}
        <link rel="stylesheet" href="{{ get_url(path="custom.css") }}">
    {% endif %}

    {%- if config.extra.visual.background is defined -%}
        {# Get position #}
        {% if config.extra.visual.background_position is defined %}
        {% set img_pos = config.extra.visual.background_position %}
        {% else %}
        {% set img_pos = "center center" %}
        {% endif %}

        <style>
         .fs-split .split-image {
             background-image: url("{{ get_url(path=config.extra.visual.background) }}");
             background-position: {{ img_pos }};
         }
        </style>
    {% endif %}
{% endmacro styling %}

{% macro favicon() %}
    {%- if config.extra.favicon is defined -%}
        <link rel="shortcut icon" href="{{ get_url(path=config.extra.favicon) }}" type="image/x-icon" />
    {%- endif -%}
{% endmacro favicon %}

{% macro rss() %}
    {%- if config.generate_feed -%}
        <link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS" href="{{ get_url(path="rss.xml") }}">
    {%- endif -%}
{% endmacro rss %}

{% macro fonts() %}
{% endmacro fonts %}

{% macro description() %}
    {%- if section -%}
        {%-  if section.description -%}
            {{ section.description }}
        {%- else -%}
            {{ config.description }}
        {%- endif -%}
    {%- elif page -%}
        {%- if page.description -%}
            {{ page.description }}
        {%- elif page.summary -%}
            {{ page.summary | striptags | truncate(length=200) }}
        {%- else -%}
            {{ config.description }}
        {%- endif -%}
    {%- else -%}
    {{ config.description }}
    {%- endif -%}
{% endmacro description %}

{% macro general_meta() %}
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
    <meta name="description" content="{{ head::description() }}"/>
{% endmacro general_meta %}
